﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;
using System.Data.EntityClient;
using WA.Core.DomainModel;
using WA.Core.Employees.Model;


[assembly: global::System.Data.Objects.DataClasses.EdmSchemaAttribute()]
namespace WA.Data
{    
    public partial class WAObjectContext : global::System.Data.Objects.ObjectContext
    {
        /// <summary>
        /// Initializes a new WebAccountantEntities object using the connection string found in the 'WebAccountantEntities' section of the application configuration file.
        /// </summary>
        public WAObjectContext() :
            base("name=WebAccountantEntities", "WebAccountantEntities")
        {
           // this.OnContextCreated();
        }
        /// <summary>
        /// Initialize a new WebAccountantEntities object.
        /// </summary>
        public WAObjectContext(string connectionString) :
            base(connectionString, "WebAccountantEntities")
        {
            //this.OnContextCreated();
        }
        /// <summary>
        /// Initialize a new WebAccountantEntities object.
        /// </summary>
        public WAObjectContext(global::System.Data.EntityClient.EntityConnection connection) :
            base(connection, "WebAccountantEntities")
        {
            //this.OnContextCreated();
        }
        //partial void OnContextCreated();
        /// <summary>
        /// There are no comments for employee in the schema.
        /// </summary>
        public global::System.Data.Objects.ObjectQuery<Employee> Employees
        {
            get
            {
                if ((this._employee == null))
                {
                    this._employee = base.CreateQuery<Employee>("[Employee]");
                }
                return this._employee;
            }
        }
        
       
        private global::System.Data.Objects.ObjectQuery<Employee> _employee;


        public global::System.Data.Objects.ObjectQuery<SalaryCalculation> SalaryCalculations
        {
            get
            {
                if ((this._salaryCalculation == null))
                {
                    this._salaryCalculation = base.CreateQuery<SalaryCalculation>("[SalaryCalculation]");
                }
                return this._salaryCalculation;
        
           
            }
        }

        private global::System.Data.Objects.ObjectQuery<SalaryCalculation> _salaryCalculation;

       
        public global::System.Data.Objects.ObjectQuery<Company> Companies
        {
            get
            {
                if ((this._company == null))
                {
                    this._company = base.CreateQuery<Company>("[Company]");
                }
                return this._company;

            }
        }

        private global::System.Data.Objects.ObjectQuery<Company> _company;

       
        
        
        public global::System.Data.Objects.ObjectQuery<Invoice> Invoices
        {
            get
            {
                if ((this._invoice == null))
                {
                    this._invoice = base.CreateQuery<Invoice>("[Invoice]");
                }
                return this._invoice;


            }
        }

        private global::System.Data.Objects.ObjectQuery<Invoice> _invoice;


        public global::System.Data.Objects.ObjectQuery<Partner> Partners
        {
            get
            {
                if ((this._partner == null))
                {
                    this._partner = base.CreateQuery<Partner>("[Partner]");
                }
                return this._partner;
            }
        }

        private global::System.Data.Objects.ObjectQuery<Partner> _partner;


        public void AddCompany(Company company)
        {
            this.AddObject("Company", company);
        }

        public void AddPartner(Partner partner)
        {
            this.AddObject("Partner", partner);
        }

        public void AddInvoice(Invoice invoice)
        {
            this.AddObject("Invoice", invoice);
        }

        /// <summary>
        /// There are no comments for employee in the schema.
        /// </summary>
        //public void AddToEmployee(Employee employee)
        //{
        //    base.AddObject("Employee", employee);
        //}
    }
}
